#pragma once
#include "Array2D.h"
#include "Array3D.h"
#include "coords.h"
#include "Keyboard.h"
#include "hero.h"
#include "stdafx.h"

#include <fstream>
#include <iostream>
#include <conio.h>

#define ROT_LEFT		1
#define ROT_RIGHT		2
#define ROT_CLKWISE		3
#define ROT_CCLKWISE	4

class CHero;
typedef shared_ptr<CHero> PHero;

class CCube
{
public:
				CCube();
				~CCube();

	void		Update();
	void		Draw(PArray2D& disp);
	void		Rotate(int dir);

	void		setCrossSection(const PCoords& pos);
	PArray2D	getSurrCells(const PCoords& pos);
	PArray2D	getCrossSection()		{ return crSection; };
	
	PCoords		Size()					{ return cube->Size(); };
	inline int	XSize()					{ return cube->XSize(); };
	inline int	YSize()					{ return cube->YSize(); };
	inline int	ZSize()					{ return cube->ZSize(); };
	
	void		setHeroPtr(PHero ph)	{ hero = ph; }

private:
	PArray2D	crSection;	// crSectionBg;
	PArray3D	cube;
	PHero		hero;
};

typedef shared_ptr<CCube> PCube;
